<?php

use yii\widgets\ActiveForm;
use common\helpers\Url;
use common\enums\StatusEnum;

$form = ActiveForm::begin([
    'id' => $model->formName(),
    'enableAjaxValidation' => true,
    'validationUrl' => Url::to(['ajax-edit', 'id' => $model['id']]),
    'fieldConfig' => [
        'template' => "<div class='col-sm-2 text-right'>{label}</div><div class='col-sm-10'>{input}\n{hint}\n{error}</div>",
    ]
]);
//Yii::$app->debris->p($model->getStartTransitions());
?>

    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
        <h4 class="modal-title">基本信息</h4>
    </div>
    <div class="modal-body">
        <?= $form->field($model, 'serial')->textInput(['maxlength' => true]) ?>
        <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
        <?= $form->field($model, 'idcard')->textInput() ?>
        <?= $form->field($model, 'political')->dropDownList(\addons\Employees\common\enums\PoliticalEnum::getMap()) ?>

        <?= $form->field($model, 'native')->textInput(['placeholder'=>'默认自动生成，如添加失败请手动输入']) ?>
        <?= $form->field($model, 'education')->textInput() ?>
        <?= $form->field($model, 'colleges')->textInput() ?>
        <?= $form->field($model, 'residence')->textInput(['placeholder'=>'默认自动生成，如添加失败请手动输入']) ?>
        <?= $form->field($model, 'mobile')->textInput() ?>
        <?= $form->field($model, 'mail')->textInput() ?>
        <?= $form->field($model, 'covers')->widget(common\widgets\webuploader\Files::class, [
            'config' => [
                'pick' => [
                    'multiple' => true,
                ],
            ]
        ])->hint('第一张图片将作为主图,支持同时上传多张图片,多张图片之间可拖动调整位置'); ?>

    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
        <button class="btn btn-primary" type="submit">保存</button>
    </div>
<?php ActiveForm::end(); ?>